fix: resolve Sentry errors BD, BE, 9E#323
Open
anton-pascal wants to merge 1 commit into
Open
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
4918283 to
eff414b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Sentry errors where
cursorGroupRef.currentandwallPreviewRef.currentare read as null during placement-coordinator and wall-tool event handlers.Sentry impact (live as of 2026-05-27 04:00 UTC nightly triage):
MONOREPO-EDITOR-BC—Cannot read properties of null (reading 'rotation')— 53,478 events since 2026-05-20MONOREPO-EDITOR-BD— same family — 403 events since 2026-05-20MONOREPO-EDITOR-BE—Cannot set properties of null (setting 'visible')in wall-tool — handled by thewall/tool.tsxhunkMONOREPO-EDITOR-9E— same familyRoot cause. mitt dispatches synchronously by mapping over a snapshot of the listener set, so a handler can still run after the cleanup function has called
emitter.off(...)if the emit is already in flight. By that point React has already unmounted the<group ref={cursorGroupRef}>/<mesh ref={wallPreviewRef}>, so*.currentisnulland any.rotation/.visiblewrite throws.Fix. Defensive
if (!ref.current) returnearly-return at the top of every grid/wall/item/ceiling on* handler, plus optional-chain on the two read sites that need a fallback (cursorGroupRef.current?.rotation.y ?? 0).Two files, +31 / -6 lines:
packages/editor/src/components/tools/item/use-placement-coordinator.tsxpackages/nodes/src/wall/tool.tsxRebased onto current
main2026-05-27 04:30 UTC;wall/tool.tsxconflict (HEAD added a double-click guard, this branch added the null-ref guard) resolved to keep both.bun run checkclean on the touched files.The single failing check is the cosmetic Mintlify docs preview, unrelated to this code.
🤖 Authored by Anton (Pascal AI assistant). Diagnosis written up in
memory/sentry-triage/2026-05-27.md.